
setShop()
function setShop (){
  var tbody = document.querySelector("#tbody")
  utils.fetchG("./api/V1/shop/select.php").then(resp => {
    var arr = resp.body.list
    if (resp.code == 200) {
      var tr = ''
      arr.forEach((item, index) => {
        tr += `<tr index="${item.Id}" id="tr">
                    <td>${index + 1}</td>
                    <td>
                      <span>${item.name}</span>
                      <input type="text" autofocus>
                    </td>
                    <td>
                      <span>${item.price}</span>
                      <input type="number">
                    </td>
                    <td>
                      <span>${item.num}</span>
                      <input type="number">
                    </td>
                    <td>
                      <button type="button" class="btn btn-primary btn-sm" id="btn-edit">编辑</button>
                      <button type="button" class="btn btn-danger btn-sm">删除</button>
                      <button type="button" class="btn btn-success btn-sm">确认</button>
                      <button type="button" class="btn btn-info btn-sm">取消</button>
                    </td>
           </tr>`
      })
      tbody.innerHTML = tr
    }
  })
}